package com.macro.mall.tiny.common.api;

/**
 * @auther zhuyi
 * @description 枚举了一些常用API操作码
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    AUTHCODE_NOTEXIST(601,"验证码失效"),
    CODECHECK_FAILED(602,"验证码错误，请重新校验"),
    USERNAME_HASEXIST(603,"用户名已存在"),
    PHONE_HASEXIST(604,"该手机号已被注册"),
    ROLE_HASEXIST(605,"角色人物已配置"),
    USER_NOTEXIST(606,"用户不存在" ),
    ADMINFORBID(607,"不能处理管理员信息" ),
    AUTHCODE_HASEXIST(608,"验证码已存在" );
    private long code;
    private String message;

    private ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    public long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
